<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Element Plus demo - 反馈组件</title>
</head>

<body>


  文档地址：https://element-plus.org/zh-CN/guide/design.html
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css" />
  <!-- import JavaScript -->
  <script src="https://unpkg.com/element-plus"></script>
  <div id="app">
    <el-button :plain="true" @click="test">经典用法</el-button>
    <hr />
    <el-button :plain="true" @click="open2">success</el-button>
    <el-button :plain="true" @click="open3">warning</el-button>
    <el-button :plain="true" @click="open1">message</el-button>
    <el-button :plain="true" @click="open4">error</el-button>
  </div>

  <script>
    const App = {
      setup() {
        const message = Vue.ref("1111");
        const test = () => {
          ElementPlus.ElMessage({
            message: "this is a message.",
            grouping: true,
            type: "success",
          });
        };
        const open1 = () => {
          ElementPlus.ElMessage("一个简单提示");
        };

        const open2 = () => {
          ElementPlus.ElMessage({
            message: "Congrats, this is a success message.",
            type: "success",
          });
        };
        const open3 = () => {
          ElementPlus.ElMessage({
            showClose: true,
            message: "Warning, this is a warning message.",
            type: "warning",
          });
        };
        const open4 = () => {
          ElementPlus.ElMessage.error("Oops, this is a error message.");
        };

        return {
          test,
          open1,
          open2,
          open3,
          open4,
        };
      },
    };
    const app = Vue.createApp(App);
    app.use(ElementPlus);
    app.mount("#app");
  </script>
</body>

</html>